package com.qhgrain.app.constant;

import java.util.ArrayList;
import java.util.List;

import com.qhgrain.app.vo.PairVo;


public enum AppBusinessTypeEnum {

	/**
	 * 数字政务云
	 */
	SHUZI_ZHENGWU("1","数字政务云"),
	/**
	 * 精确业务云
	 */
	JINGQUE_YEWU("2","精确业务云"),
	/**
	 * 智能粮库云
	 */
	ZHINENG_LIANGKU("3","智慧粮库云"),
	/**
	 * 智能辅助决策云
	 */
	ZHINENG_FUZHU("4","智能辅助决策云"),
	/**
	 *  电子商务云 
	 */
	DIANZI_SHANGWU("5", " 电子商务云"),
	/**
	 * 门户云
	 */
	MENHU("6","门户云");
	
	private String code;
	
	private String name;
	
	
	private AppBusinessTypeEnum(String code,String name){
		this.code = code;
		this.name = name;
	}
	
	public static List<PairVo> getAll(){
		List<PairVo> list = new ArrayList<PairVo>();
		for(AppBusinessTypeEnum e : AppBusinessTypeEnum.values()){
			list.add(new PairVo(e.getCode(),e.getName()	));
		}
		return list;
	}

	public static String findName(String code){
		for(AppBusinessTypeEnum e : AppBusinessTypeEnum.values()){
			if(e.getCode().equals(code)){
				return e.getName();
			}
		}
		return "";
	}
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
